package com.nf.bookstytem.web.bookmanage;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.nf.bookstytem.model.bookmanage.BookModel;
import com.nf.bookstytem.service.bookmanage.BookManageService;
import com.nf.bookstytem.uitl.JsonUtil;
@WebServlet("/bookmanage/selectbyname")
public class BookSelectByNameLikeServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		BookManageService service=new BookManageService();
		String biname=req.getParameter("biname").trim();
		List<BookModel> list=service.getLikeListByName(biname);
		String result = JsonUtil.toJson(list);
		
		resp.setContentType("application/json;charset=UTF-8");
		resp.getWriter().println(result);
	}
}
